<template>
	<div>
		<el-form ref="form" :model="sizeForm"  label-width="80px" size="mini">
		  <el-form-item label="标题">
		    <el-input v-model="sizeForm.title"></el-input>
		  </el-form-item>
		  <el-form-item label="选择">
		    <el-input v-for="list in sizeForm.data" v-model="list.value" style="width: 200px;" placeholder="请输入内容"></el-input><span class="el-icon-plus" @click="add()"></span>
		  </el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
	    data() {
	      return {
	        sizeForm: {
			  id:'',
			  index: '',
			  title: '',
			  data:[{
				  lable:"",
				  value:""
			  }],
			  maxlength: '',
			  minlength: '',
			  isNot:'1'
	        }
	      };
	    },
		props:['msgJsonApp'],
		created() {
			console.log(JSON.stringify(this.sizeForm))
			this.sizeForm=JSON.parse(this.msgJsonApp.msgJson)
			this.sizeForm.index = this.msgJsonApp.index
			this.sizeForm.id = this.msgJsonApp.id
		},
	    methods: {
			add(){
				var data={
					lable:"",
					value:"值"
				}
				this.sizeForm.data.push(data)
			},
	      show() {
	        return this.sizeForm
	      }
	    },
		watch: {
			'msgJsonApp.index': {
				handler(newValue, oldValue) {
				 this.sizeForm=JSON.parse(this.msgJsonApp.msgJson)
				 this.sizeForm.index = this.msgJsonApp.index
				},
				deep: true
			},
			'sizeForm': {
				handler(newValue, oldValue) {
					this.$parent.fatherMethod(newValue);
				},
				deep: true
			}
		}
	  };
</script>

<style>
</style>
